package org.mat.ipaas.ucenter.service.api.system;

import com.alibaba.fastjson.JSONObject;
import org.mat.framework.lang.dto.MatApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 第三方App对接
 */
@FeignClient(name = "mat-ipaas-ucenter-service",contextId = "third-app-rest-api")
public interface ThirdAppRestAPI {

    /**
     * 获取启用的系统
     */
    @GetMapping("/sys/thirdApp/getEnabledType")
    MatApiResponse getEnabledType();

    /**
     * 同步本地[用户]到【企业微信】
     *
     * @param ids
     * @return
     */
    @GetMapping("/sys/thirdApp/sync/wechatEnterprise/user/toApp")
    MatApiResponse syncWechatEnterpriseUserToApp(@RequestParam(value = "ids", required = false) String ids);

    /**
     * 同步【企业微信】[用户]到本地
     *
     * @param ids 作废
     * @return
     */
    @GetMapping("/sys/thirdApp/sync/wechatEnterprise/user/toLocal")
    MatApiResponse syncWechatEnterpriseUserToLocal(@RequestParam(value = "ids", required = false) String ids);

    /**
     * 同步本地[部门]到【企业微信】
     *
     * @param ids
     * @return
     */
    @GetMapping("/sys/thirdApp/sync/wechatEnterprise/depart/toApp")
    MatApiResponse syncWechatEnterpriseDepartToApp(@RequestParam(value = "ids", required = false) String ids);

    /**
     * 同步【企业微信】[部门]到本地
     *
     * @param ids
     * @return
     */
    @GetMapping("/sys/thirdApp/sync/wechatEnterprise/depart/toLocal")
    MatApiResponse syncWechatEnterpriseDepartToLocal(@RequestParam(value = "ids", required = false) String ids);

    /**
     * 同步本地[部门]到【钉钉】
     *
     * @param ids
     * @return
     */
    @GetMapping("/sys/thirdApp/sync/dingtalk/depart/toApp")
    MatApiResponse syncDingtalkDepartToApp(@RequestParam(value = "ids", required = false) String ids);

    /**
     * 同步【钉钉】[部门]到本地
     *
     * @param ids
     * @return
     */
    @GetMapping("/sys/thirdApp/sync/dingtalk/depart/toLocal")
    MatApiResponse syncDingtalkDepartToLocal(@RequestParam(value = "ids", required = false) String ids);

    /**
     * 同步本地[用户]到【钉钉】
     *
     * @param ids
     * @return
     */
    @GetMapping("/sys/thirdApp/sync/dingtalk/user/toApp")
    MatApiResponse syncDingtalkUserToApp(@RequestParam(value = "ids", required = false) String ids);

    /**
     * 同步【钉钉】[用户]到本地
     *
     * @param ids 作废
     * @return
     */
    @GetMapping("/sys/thirdApp/sync/dingtalk/user/toLocal")
    MatApiResponse syncDingtalkUserToLocal(@RequestParam(value = "ids", required = false) String ids);

    /**
     * 发送消息测试
     *
     * @return
     */
    @PostMapping("/sys/thirdApp/sendMessageTest")
    MatApiResponse sendMessageTest(@RequestHeader("X-Access-Token") String accessToken,
                                   @RequestBody JSONObject params);

    /**
     * 撤回消息测试
     *
     * @return
     */
    @PostMapping("/sys/thirdApp/recallMessageTest")
    MatApiResponse recallMessageTest(@RequestBody JSONObject params);

}
